const getMemberPage = (params) => {
    return $axios({
        url: '/member/page',
        method: 'get',
        params
    })
}

//新增会员
const addMember = (params) => {
    return $axios({
        url: '/member',
        method: 'post',
        data: {...params}
    })
}

// 查询详情
const queryMemberById = (userId) => {
    return $axios({
        url: `/member/${userId}`,
        method: 'get'
    })
}

// 修改接口
const editMember = (params) => {
    return $axios({
        url: '/member/edit',
        method: 'put',
        data: {...params}
    })
}

//状态修改
function enableOrDisableStatus(params) {
    return $axios({
        url: '/member/status',
        method: 'put',
        data: {...params}
    })
}

// 删除接口
const deleteMember = (userId) => {
    return $axios({
        url: `/member/${userId}`,
        method: 'delete'
        // params: { userId }
    })
}

//通过memberId查看会员的卡
const getByIdWithCards = (userId) => {
    return $axios({
        url: `/member/cards/${userId}`,
        method: 'get'
    })
}

//通过userId查看老师的所有课程
const getByIdWithClasses = (memberId) => {
    return $axios({
        url: `/member/classes/${memberId}`,
        method: 'get'
    })
}

// 分页查询全部card的信息
const getCardPage = (params) => {
    return $axios({
        url: '/card/page',
        method: 'get',
        params
    })
}
// 分页查询全部card的信息
const getCardsNotSelected = (params) => {
    return $axios({
        url: '/member/getCardsNotSelected',
        method: 'get',
        params
    })
}

//  /user/saveByCardId/3  post   为该会员选择会员卡saveByIdWithCard
const saveByIdWithCard = (params) => {
    return $axios({
        url: `/member/saveByCardId`,
        method: 'post',
        params
    })
}
